home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Shareware Plus / Developers / LogoMation 1.1.4 ƒ / Examples / Yuval's / PieGraph Maker / PieGraph / PieGraph
Encoding:
Text File  |  1996-05-21  |  2.8 KB  |  140 lines  |  [UVtx/UVtl]

  1. ////////////////////////////////////////////////////
  2. ////////////////////////////////////////////////////
  3. ////////////////////////////////////////////////////
  4. ////////////////////////////////////////////////////
  5. /////////////////// The PieChart ///////////////////
  6. ////////////////////////////////////////////////////
  7. ////////////////////////////////////////////////////
  8. ////////////////////////////////////////////////////
  9. ////////////////// By Yuval Shavit /////////////////
  10. ////////////////////////////////////////////////////
  11. ////////////////////////////////////////////////////
  12. ////////////////////////////////////////////////////
  13. ////////////////////////////////////////////////////
  14. ////////////////////////////////////////////////////
  15. ////////////////////////////////////////////////////
  16.  
  17. //first the intro..
  18. Up
  19. Goto -400,300,0
  20. Down
  21. Pen speed=500
  22. Pen picture="1"
  23. Goto -180,0,0
  24. Up
  25. Goto 400,300,0
  26. Down
  27. Pen picture="2"
  28. Goto 0,0,0
  29. Pen picture="1"
  30. Up
  31. Goto -100,-500,0
  32. Down
  33. Pen picture="r3"
  34. Goto -180,-180,0
  35. Up
  36. Goto 180,10,0
  37. Down
  38. Pen picture=""
  39. Fill 1
  40.     Right 45
  41.     Forward 11
  42.     Left 135
  43.     Forward 8
  44.     Left 5
  45.     Forward 8
  46.     Left 90
  47.     Forward 8
  48. Pause 1.5
  49. Clear
  50. //then a few functions...
  51.  
  52. Function updown(xx,yy)
  53.     Up
  54.     Goto xx,yy,0
  55.     Down
  56. Function space()
  57.     updown(130,190)
  58.     Color 65535,65535,65535
  59.     Left 90
  60.     Backward 3
  61.     Fill 1
  62.         Repeat 2
  63.             Forward 16
  64.             Right 90
  65.             Forward 150
  66.             Right 90
  67.     Color 0,0,0
  68.  
  69. //...now three variables...
  70.  
  71. na=-90
  72. hh=-100
  73. pt=0
  74.  
  75. //...a starting posision...
  76. Up
  77. Goto 0,0,-na
  78. Down
  79. //...and we're set!
  80. Function mainthing()
  81.     Repeat
  82.         space()
  83.         Color 0,0,0
  84.         Print "Percent? ",move
  85.         p=ask(50)
  86.         pt=pt+p
  87.         If pt>100
  88.             Sound "Wild Eep"
  89.             pt=pt-p
  90.             mainthing()
  91.         space()
  92.         Print "Label? ",move
  93.         l=ask(100)
  94.         a=(p/100)*(200*π)
  95.         space()
  96.         Up
  97.         Goto 0,0,na
  98.         Down
  99.         
  100.         //let's mess with colors...
  101.         c=random(65535)
  102.         cc=random(65535)
  103.         ccc=random(65535)
  104.         Color c,cc,ccc
  105.         //now back to the actual program    
  106.         
  107.         Fill 1
  108.             Forward 100
  109.             Right 90
  110.             Circle -100
  111.             Forward a
  112.             Straight
  113.             Right 90
  114.             Forward 100
  115.         Right 180
  116.         na=dir()
  117.         updown(-210,hh)
  118.         Left 90
  119.         Fill 1
  120.             Repeat 4
  121.                 Forward 10
  122.                 Right 90
  123.         Color 0,0,0
  124.         Up
  125.         Right 90
  126.         Forward 12
  127.         Down
  128.         Print " = ".l.", ".p."%"
  129.         hh=hh+20
  130.         If pt=100
  131.             space()
  132.             Color 0,0,00
  133.             Width 3
  134.             Up
  135.             Goto 101,0,90
  136.             Down
  137.             Circle 101
  138.             Forward 202*π    
  139.             Halt
  140. mainthing()